<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>v-show</title>
</head>
<body>
<div id="app">
<!--  v-show两种状态 true和false-->
  <input type="submit" value="切换显示状态" @click="changeIsShow">
  <img v-show="isShow" src="icon.png">
  <img v-show="age>18" src="icon.png">
  <input type="submit" value="age" @click="ageAdd">
</div>

<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
  var app=new Vue({
    el:"#app",
    data:{
      isShow:false,
      age:16
    },
    methods:{
      changeIsShow:function (){
        this.isShow=!this.isShow
      },
      ageAdd:function (){
        this.age++;
      }
    }
  })
</script>
</body>
</html>
